package com.mofeng.myshop.domain.dto.search;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mofeng.myshop.domain.dto.base.SearchBaseMp;
import com.mofeng.myshop.domain.po.Commodity;
import com.mofeng.myshop.until.MyUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Builder(toBuilder = true)
public class CommoditySearchDto extends SearchBaseMp {
    @Schema(description = "商品基础价格")
    private Float basePrice;
    @Schema(description = "商品价格")
    private Float price;
    @Schema(description = "商品类别ID")
    private Long commodityCategoryId;
    @Schema(description = "商品类别ID")
    private Long projectId;

    public void setCommodityCategoryId(String commodityCategoryId) {
        this.commodityCategoryId = MyUtil.NumberUtil.asLong(commodityCategoryId);
    }

    public void setProjectId(String projectID) {
        this.projectId = MyUtil.NumberUtil.asLong(projectID);
    }

    public Page<Commodity> getPageMp() {
        return super.getPageMp(Commodity.class);
    }
}
